package com.enjoy.studyfragment.fragment;

import com.enjoy.mjbaseframe.base.BaseMainFragment;
import com.enjoy.studyfragment.R;

import butterknife.BindView;
import me.wangyuwei.particleview.ParticleView;

/**
 * Created by Administrator on 2018/3/14.
 */

public class SplashFragment extends BaseMainFragment {

    @BindView(R.id.pv)
    ParticleView pv;

    @Override
    public Object setLayout() {
        return R.layout.fragemnt_splash;
    }

    @Override
    public void init() {
        super.init();
//        new Handler().postDelayed(new Runnable() {
//            @Override
//            public void run() {
//                replaceFragment(new LoginFragment(),false);
//            }
//        }, 2000);

        pv.setOnParticleAnimListener(new ParticleView.ParticleAnimListener() {
            @Override
            public void onAnimationEnd() {
                extraTransaction().setCustomAnimations(onCreateFragmentAnimator().getEnter(),onCreateFragmentAnimator().getPopExit(),
                        onCreateFragmentAnimator().getPopEnter(),onCreateFragmentAnimator().getExit());
                replaceFragment(new LoginFragment(),false);
            }
        });
        pv.startAnim();
    }
}
